﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Antlr.Runtime;
using Antlr.Runtime.Tree;
using Microsoft.Scripting.Hosting;

namespace JavascriptEngine
{
    class Program
    {
        static void Main(string[] args)
        {
            Host host = new Host();
            ScriptScope scope = host.Run(@"test.js");
            foreach (string var in scope.GetVariableNames())
                Console.WriteLine(var + " : " + scope.GetVariable(var).ToString());
        }
    }
}

public static class Extensions
{
    public static bool Matches(this string str, string regex)
    {
        Regex regularExpression = new Regex(regex);
        return regularExpression.IsMatch(str);
    }
}
